

function gradient(id, level)
{
	var box = document.getElementById(id);
	box.style.opacity = level;
	box.style.MozOpacity = level;
	box.style.KhtmlOpacity = level;
	box.style.filter = "alpha(opacity=" + level * 100 + ")";
	box.style.display="block";
	return;
}


function fadein(id)
{
	var level = 0;
	while(level <= 1)
	{
		setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10);
		level += 0.01;
	}
}


// Open the lightbox

function openbox(formtitle, fadin, filterId, boxId, boxtitleId)
{
  var box = document.getElementById(boxId);
  document.getElementById(filterId).style.display = 'block';

  var btitle = document.getElementById(boxtitleId);
  btitle.innerHTML = formtitle;
  
  if(fadin)
  {
      gradient(boxId, 0);
      fadein(boxId);
  }
  else
  { 	
    box.style.display='block';
  }
}

//function openbox(formtitle, fadin) {
//    var box = document.getElementById('box1');
//    document.getElementById('filter1').style.display = 'block';

//    var btitle = document.getElementById('boxtitle1');
//    btitle.innerHTML = formtitle;

//    if (fadin) {
//        gradient("box1", 0);
//        fadein("box1");
//    }
//    else {
//        box.style.display = 'block';
//    }
//}


// Close the lightbox

function closebox(filterId, boxId) {
    document.getElementById(boxId).style.display = 'none';
    document.getElementById(filterId).style.display = 'none';
}

//function closebox()
//{
//   document.getElementById('box1').style.display='none';
//   document.getElementById('filter1').style.display='none';
//}



